#include<stdio.h>
#include <sys/types.h>
#include <unistd.h>


int main(){
    pid_t pid = fork();
    if(pid == -1){
        perror("fork fail");
        return 1;
    }
    else if(pid == 0){
        printf("i am child process\n");
    }
    else{
        printf("i am father process\n");
    }
    pid_t mypid = getpid();
    printf("my pid is %d\n",mypid);
    return 0;
}